package com.hydra.startup.daos;

import java.io.Serializable;
import java.util.List;

import org.hibernate.criterion.DetachedCriteria;

public interface CommonDao<T> {
	
	/*
	 *  Base interface for CRUD operations and common queries
	 */
	public List<T> loadAll();
	
	public void save(T bean);
	
	public void update(T bean);
	
	public void delete(T bean);
	
	public T get(Serializable id);
	
	/*
	 *  Get List by criteria
	 *  @param detachCriteria the domain query criteria, it includes condition and orders
	 *  @return
	 */
	
	public List<T> getListByCriteria(DetachedCriteria detachedCriteria);
	
	public List<T> getListByCriteria(DetachedCriteria detachedCriteria, int offset, int size);
}
